Field
The teachings in accordance with the exemplary embodiments of this present disclosure generally relate to a method for setting capacity of buffer, and more particularly to a method for setting capacity of buffer configured to efficiently use a buffer by proactively setting a buffer capacity in response to a use environment.
Background
A communication system uses a buffer for preventing loss of transmitting/receiving messages generated in the course of processing the transmitting/receiving messages by a CPU.
FIG. 1 is a schematic view illustrating a buffer use state in a communication system according to prior art.
Referring to FIG. 1, the conventional communication system is formed therein with a buffer (1) for communication (hereinafter referred to as ‘communication buffer’). The communication buffer (1) may include a transmission buffer (2) and a reception buffer (3), where a sum of a capacity of the transmission buffer (2) and a capacity of the reception buffer (3) is a total amount of the communication buffer (1). Thus, when a capacity of the transmission buffer (2) and a capacity of the reception buffer (3) are added, the addition takes up 100% of the entire communication buffer (1).
At this time, generation frequency of transmission/reception messages is changed depending on an environment the communication system is used, and a communication device developer or user must set a resistor or a parameter according to the message generation frequency to determine a capacity of transmission buffer and a capacity of reception buffer.
In general, the communication system is configured such that when a capacity of one buffer is fully loaded in a transmission buffer and a reception buffer, a message is so set as to be disposed from a message reception function or a transmission message generation function, even if a capacity of the other buffer is remain left. Although a problem of disposing of a message can be solved because a capacity can be appropriately set and changed when a developer or a user sets a buffer capacity, there is a problem of the size of the buffer must be changed by a user because the frequency of transmission/reception messages is frequently changed at all times. Furthermore, there is no solution when a capacity of buffer cannot be changed by a user through parameter setting.